<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>My JSP 'add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
<meta http-equiv="description" content="This is my page" />
<link rel="stylesheet" type="text/css" href="/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/css/common.css" />
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formcheck/formcheck-0.0.1.js"></script>
  </head>
  
  <body class="mainframe">
    <form action="/admin/user/edit.dhtml" method="post">
    	<input type="hidden" value="<c:out value="${user.id }" />" />
    	<table class="form01">
    		<caption>修改用户</caption>
    		<tr>
    			<td>用户名</td>
    			<td><input name="user.loginname" value="<c:out value="${user.loginname}" />" /></td>
    		</tr>
    		<tr>
    			<td>邮箱</td>
    			<td><input type="text" name="user.email" value="<c:out value="${user.email }" />" /></td>
    		</tr>
    		<tr>
    			<td></td>
    			<td><input id="submit_user" class="button01" value="修改" /></td>
    		</tr>
    	</table>
    </form>
    
    <script type="text/javascript" >
    	$(document).ready(function(){
    		$("#submit_user").click(function(){
    			var result = true;
    			
    			if(result)
    				result = formCheck.checkEmpty($("#user_loginname"), "请输入登录名");
    			if(result)
    				result = formCheck.checkEmpty($("#user_pwd"), "请输入密码");
    			if(result)
    				result = formCheck.checkEmpty($("#user_repwd"), "请再次输入密码");
    			if(result)
    				result = formCheck.checkEmpty($("#user_email"), "请输邮件地址");
    			return result;
    		});
    	});
    </script>
  </body>
</html>